package net.minecraft.util.packrat;

import com.mojang.brigadier.StringReader;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;

public class AnyIdParsingRule implements ParsingRule<StringReader, Identifier> {
	public static final ParsingRule<StringReader, Identifier> INSTANCE = new AnyIdParsingRule();

	private AnyIdParsingRule() {
	}

	@Nullable
	public Identifier parse(ParsingState<StringReader> parsingState) {
		parsingState.getReader().skipWhitespace();

		try {
			return Identifier.fromCommandInputNonEmpty(parsingState.getReader());
		} catch (CommandSyntaxException var3) {
			return null;
		}
	}
}
